package com.ruoyi.hqfinance.service.impl;

import com.github.pagehelper.PageHelper;
import com.ruoyi.hqfinance.domain.HqEnterOperateFee;
import com.ruoyi.hqfinance.domain.vo.HqEnterOperateFeeVo;
import com.ruoyi.hqfinance.mapper.HqEnterOperateFeeMapper;
import com.ruoyi.hqfinance.service.HqEnterOperateFeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HqEnterOperateFeeServiceImpl implements HqEnterOperateFeeService {
    @Autowired
    private HqEnterOperateFeeMapper hqEnterOperateFeeMapper;
    @Override
    public List<HqEnterOperateFee> collect(HqEnterOperateFeeVo vo) {
        PageHelper.startPage(vo.getPageDate());
        List<HqEnterOperateFee> enterOperateFees = hqEnterOperateFeeMapper.collect(vo);
        assert enterOperateFees != null;
        for (HqEnterOperateFee hqEnterOperateFee : enterOperateFees){
            hqEnterOperateFee.setCollectDate(vo.getStartTime() + "至" + vo.getEndTime());
        }
        return enterOperateFees;
    }
}
